Greedy flipping of pancakes and burnt pancakes
نویسندگان
چکیده
We prove that a stack of n pancakes is rearranged in all n! ways by repeatedly applying the following rule: Flip the maximum number of pancakes that gives a new stack. This complements the previously known pancake flipping Gray code (S. Zaks, A New Algorithm for Generation of Permutations BIT 24 (1984), 196–204) which we also describe as a greedy algorithm: Flip the minimum number of pancakes that gives a new stack. Surprisingly, these maximum and minimum flip algorithms also rearrange stacks of n ‘burnt’ pancakes in all 2n! ways. We conjecture that these four algorithms are essentially the only greedy algorithms for rearranging pancakes and burnt pancakes in all possible ways using flips.
منابع مشابه
Successor rules for flipping pancakes and burnt pancakes
A stack of n pancakes can be rearranged in all n! ways by a sequence of n!−1 flips, and a stack of n ‘burnt’ pancakes can be rearranged in all 2nn! ways by a sequence of 2nn!−1 flips. In both cases, a computer program can efficiently generate suitable solutions. We approach these tasks instead from a human perspective. How can we determine the next flip directly from the current stack? How can ...
متن کاملPancake Flipping Is Hard
Pancake Flipping is the problem of sorting a stack of pancakes of different sizes (that is, a permutation), when the only allowed operation is to insert a spatula anywhere in the stack and to flip the pancakes above it (that is, to perform a prefix reversal). In the burnt variant, one side of each pancake is marked as burnt, and it is required to finish with all pancakes having the burnt side d...
متن کاملGreedy Pancake Flipping
We prove that a stack of pancakes can be rearranged in all possible ways by a greedy process: Flip the maximum number of topmost pancakes that gives a new stack. We also show that the previous Gray code for rearranging pancakes (S. Zaks, A New Algorithm for Generation of Permutations BIT 24 (1984), 196-204) is a greedy process: Flip the minimum number of topmost pancakes that gives a new stack.
متن کاملComputing with living hardware
Our multi-institutional team of eleven undergraduates, one high school student, one postdoctoral fellow, and four faculty members explored the emerging field of synthetic biology and presented our results at the 2006 international Genetically Engineered Machine (iGEM) competition. Having had little or no previous research experience, biology, chemistry and mathematics students from four differe...
متن کاملPolynomial-time sortable stacks of burnt pancakes
Pancake flipping, a famous open problem in computer science, can be formalised as the problem of sorting a permutation of positive integers using as few prefix reversals as possible. In that context, a prefix reversal of length k reverses the order of the first k elements of the permutation. The burnt variant of pancake flipping involves permutations of signed integers, and reversals in that ca...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- Discrete Applied Mathematics
دوره 210 شماره
صفحات -
تاریخ انتشار 2016